{extend name="public/common"}

{block name="style"}

<link rel="stylesheet" href="__HOME__/css/sign/detail.css">
{/block}

{block name="body"}
<div class="viewBox">
    <div>
        <p ><img src="__HOME__/images/sign/pen.png" class="img1"/><span>省份：</span></p>
        <article>
            {$msg.city || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p ><img src="__HOME__/images/sign/pen.png" class="img1"/><span>学历：</span></p>
        <article>
            {$msg.education || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p ><img src="__HOME__/images/sign/pen.png" class="img1"/><span>项目：</span></p>
        <article>
            {$msg.project_name || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p ><img src="__HOME__/images/sign/pen.png" class="img1"/><span>分校：</span></p>
        <article>
            {$msg.place || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>上课地点：</span></p>
        <article>
            {$msg.address || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>课程名称：</span></p>
        <article>
            {$msg.name || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>科目：</span></p>
        <article>
            {$msg.subject || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>阶段：</span></p>
        <article>
            {$msg.stage_name || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>模块：</span></p>
        <article>
            {$msg.module || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>上课日期：</span></p>
        <article>
            {$msg.start_time|time_format='Y年m月d日' || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>上课星期：</span></p>
        <article>
            {$msg.week || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>上课时间：</span></p>
        <article>
            {$msg.start_time|time_format='H:i' || default='*暂无'}--{$msg.end_time|time_format='H:i' || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>授课老师：</span></p>
        <article>
            {$msg.teacher || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>课次：</span></p>
        <article>
            {$msg.time_name || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
    <div >
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>是否领资料：</span></p>
        <article>
            {eq name="$msg.receive" value="1"}是{else/}否{/eq}
        </article>
    </div>
    <div class="hurdle"></div>
    <div>
        <p><img src="__HOME__/images/sign/pen.png" class="img1"/><span>授课内容：</span></p>
        <article>
            {$msg.content || default='*暂无'}
        </article>
    </div>
    <div class="hurdle"></div>
</div>
{eq name="$msg.sign_status" value="0"}
<div class="btn" id="btn">我要请假</div>
<div class="login">
    <div style="padding: 10px;font-size: 1.3rem"> * 注 ：请假后不能再进行扫码签到。</div>
</div>
{/eq}
{eq name="$msg.sign_status" value="1"}
<div class="btns">正常</div>
<div class="logins">
    <div style="padding: 10px;font-size: 1.3rem"> * 提醒：正常签到，【签到时间：{$msg.signin_time}】。</div>
</div>
{/eq}
{eq name="$msg.sign_status" value="2"}
<div class="btns">迟到</div>
<div class="logins">
    <div style="padding: 10px;font-size: 1.3rem"> * 提醒：迟到，【签到时间：{$msg.signin_time}】。</div>
</div>
{/eq}
{eq name="$msg.sign_status" value="3"}
<div class="btns">旷课</div>
<div class="logins">
    <div style="padding: 10px;font-size: 1.3rem"> * 提醒：旷课，【签到时间：{$msg.signin_time}】。</div>
</div>
{/eq}
{eq name="$msg.sign_status" value="4"}
<div class="btns">请假</div>
<div class="logins">
    <div style="padding: 10px;font-size: 1.3rem"> * 提醒：已请假，无签到数据。</div>
</div>
{/eq}
{/block}

{block name="script"}
<script src="__ADMIN__/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script>
    $('title' ).text('点对点教育VIP学员_我的课表');
    //关闭分享
    // function onBridgeReady() {
    //     WeixinJSBridge.call('hideOptionMenu');
    // }
    // if (typeof WeixinJSBridge == "undefined") {
    //     if (document.addEventListener) {
    //         document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
    //     } else if (document.attachEvent) {
    //         document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
    //         document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
    //     }
    // } else {
    //     onBridgeReady();
    // }
    wx.config({
        debug: false,
        appId: '{$jsSign.appId}', // 必填，公众号的唯一标识
        timestamp: {$jsSign['timestamp']}, // 必填，生成签名的时间戳，切记时间戳是整数型，别加引号
        nonceStr: '{$jsSign.nonceStr}', // 必填，生成签名的随机串
        signature: '{$jsSign.signature}', // 必填，签名，见附录1
        jsApiList: [
            'checkJsApi',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'hideAllNonBaseMenuItem',
        ]
    });

    wx.ready(function () {
        wx.hideAllNonBaseMenuItem();
    });
    var id="{$msg.id}";
    $('#btn').on("click",function(){
        swal({
            title: "确定请假吗？",
            text: "请假后将不能进行上课签到！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Sure",
            closeOnConfirm: false
        },
        function(){
            $.ajax({
                url: "{:Url('Sign/play')}",
                type: 'post',
                data: {
                    id: id,
                },
                success:function(data){
                    if(data.code == 1){
                        swal({
                            title: ' ',
                            text: data.msg,
                            type: 'success',
                            confirmButtonText:'确定'
                        });
                        setTimeout(function(){
                            window.location.reload();
                        },500);
                    }else{
                        swal({
                            title: ' ',
                            text: data.msg,
                            type: 'error',
                            confirmButtonText:'确定'
                        });
                    }
                }
            })
        });
    });
</script>
{/block}